<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>
    
  devstack 安装openstack - NeilBlog
  
  </title>
  
  
  <link href="atom.xml" rel="alternate" title="NeilBlog" type="application/atom+xml">
    <link rel="stylesheet" href="asset/css/foundation.min.css" />
    <link rel="stylesheet" href="asset/css/docs.css" />
    <script src="asset/js/vendor/modernizr.js"></script>
    <script src="asset/js/vendor/jquery.js"></script>
  <script src="asset/highlightjs/highlight.pack.js"></script>
  <link href="asset/highlightjs/styles/github.css" media="screen, projection" rel="stylesheet" type="text/css">
  <script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
  function before_search(){
    var searchVal = 'site: ' + document.getElementById('search_input').value;
    document.getElementById('search_q').value = searchVal;
    return true;
  }
</script>
  </head>
  <body class="antialiased hide-extras">
    
    <div class="marketing off-canvas-wrap" data-offcanvas>
      <div class="inner-wrap">


<nav class="top-bar docs-bar hide-for-small" data-topbar>


  <section class="top-bar-section">
  <div class="row">
      <div style="position: relative;width:100%;"><div style="position: absolute; width:100%;">
        <ul id="main-menu" class="left">
        
        <li id=""><a target="self" href="index.html">Home</a></li>
        
        <li id=""><a target="_self" href="archives.html">Archives</a></li>
        
        </ul>

        <ul class="right" id="search-wrap">
          <li>
<form target="_blank" onsubmit="return before_search();" action="https://google.com/search" method="get">
    <input type="hidden" id="search_q" name="q" value="" />
    <input tabindex="1" type="search" id="search_input"  placeholder="Search"/>
</form>
</li>
          </ul>
      </div></div>
  </div>
  </section>

</nav>

        <nav class="tab-bar show-for-small">
  <a href="javascript:void(0)" class="left-off-canvas-toggle menu-icon">
    <span> &nbsp; NeilBlog</span>
  </a>
</nav>

<aside class="left-off-canvas-menu">
      <ul class="off-canvas-list">
        
        <li><a target="self" href="index.html">Home</a></li>
        
        <li><a target="_self" href="archives.html">Archives</a></li>
        

    <li><label>Categories</label></li>

        
            <li><a href="Python.html">Python</a></li>
        
            <li><a href="opentstack-neutron.html">opentstack-neutron</a></li>
        
            <li><a href="%E6%8A%80%E6%9C%AF%E5%91%A8%E8%BE%B9.html">技术周边</a></li>
        
            <li><a href="%E9%A1%B9%E7%9B%AE%E7%AC%94%E8%AE%B0.html">项目笔记</a></li>
         

      </ul>
    </aside>

<a class="exit-off-canvas" href="#"></a>


        <section id="main-content" role="main" class="scroll-container">
        
       

 <script type="text/javascript">
  $(function(){
    $('#menu_item_index').addClass('is_active');
  });
</script>
<div class="row">
  <div class="large-8 medium-8 columns">
      <div class="markdown-body article-wrap">
       <div class="article">
          
          <h1>devstack 安装openstack</h1>
     
        <div class="read-more clearfix">
          <span class="date">2019/7/3</span>

          <span>posted in&nbsp;</span> 
          
              <span class="posted-in"><a href='opentstack-neutron.html'>opentstack-neutron</a></span>
           
         
          <span class="comments">
            

            
          </span>

        </div>
      </div><!-- article -->

      <div class="article-content">
      <ul>
<li>
<a href="#toc_0">参考资料</a>
</li>
<li>
<a href="#toc_1">加速环境配置</a>
<ul>
<li>
<a href="#toc_2">更新Centos镜像源</a>
</li>
<li>
<a href="#toc_3">更新pip镜像源</a>
</li>
</ul>
</li>
<li>
<a href="#toc_4">添加Stack User</a>
<ul>
<li>
<a href="#toc_5">下载devstack</a>
</li>
</ul>
</li>
</ul>


<h2 id="toc_0">参考资料</h2>

<blockquote>
<p>官方安装文档：<br/>
<a href="https://docs.openstack.org/devstack/latest/#minimal-configuration">https://docs.openstack.org/devstack/latest/#minimal-configuration</a><br/>
<a href="http://yikun.github.io/2016/02/10/%E6%90%AD%E5%BB%BAOpenStack%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/">http://yikun.github.io/2016/02/10/搭建OpenStack开发环境/</a><br/>
pip镜像修改<br/>
<a href="https://www.jianshu.com/p/db33456d5d77">https://www.jianshu.com/p/db33456d5d77</a></p>
</blockquote>

<h2 id="toc_1">加速环境配置</h2>

<h3 id="toc_2">更新Centos镜像源</h3>

<p>备份<br/>
<code>[root@localhost liuyong]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup</code><br/>
下载阿里镜像源<br/>
<code>[root@localhost liuyong]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo</code><br/>
或者更新为163镜像源<br/>
<code>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo</code><br/>
运行yum makecache生成缓存<br/>
<code>[root@localhost liuyong]# yum makecache</code></p>

<h3 id="toc_3">更新pip镜像源</h3>

<pre><code class="language-text">pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
~  
</code></pre>

<h2 id="toc_4">添加Stack User</h2>

<p>添加用户<br/>
<code>$ sudo useradd -s /bin/bash -d /opt/stack -m stack</code><br/>
赋予root权限<br/>
<code>$ echo &quot;stack ALL=(ALL) NOPASSWD: ALL&quot; | sudo tee /etc/sudoers.d/stack</code><br/>
切换用户<br/>
<code>$ sudo su - stack</code></p>

<h3 id="toc_5">下载devstack</h3>

<p><code>git clone https://git.openstack.org/openstack-dev/devstack</code><br/>
创建 local.conf<br/>
在devstack根路径创建一个local.conf文件</p>

<pre><code class="language-text">[[local|localrc]]
HOST_IP=172.18.161.6
SERVICE_HOST=172.18.161.6
MYSQL_HOST=172.18.161.6
RABBIT_HOST=172.18.161.6
GLANCE_HOSTPORT=172.18.161.6:9292
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret

## Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE=&quot;172.18.161.0/24&quot;
IPV4_ADDRS_SAFE_TO_USE=&quot;10.0.0.0/22&quot;
Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254
PUBLIC_NETWORK_GATEWAY=&quot;172.18.161.1&quot;
PUBLIC_INTERFACE=eth0

# Open vSwitch provider networking configuration
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex
</code></pre>

<p>开始安装<br/>
<code>$ ./stack.sh</code></p>


    

      </div>

      <div class="row">
        <div class="large-6 columns">
        <p class="text-left" style="padding:15px 0px;">
      
          <a href="15622929808447.html" 
          title="Previous Post: netconf client通信框架">&laquo; netconf client通信框架</a>
      
        </p>
        </div>
        <div class="large-6 columns">
      <p class="text-right" style="padding:15px 0px;">
      
          <a  href="15620552731750.html" 
          title="Next Post: neutron agent 使用netconf向设备下发配置">neutron agent 使用netconf向设备下发配置 &raquo;</a>
      
      </p>
        </div>
      </div>
      <div class="comments-wrap">
        <div class="share-comments">
          

          

          
        </div>
      </div>
    </div><!-- article-wrap -->
  </div><!-- large 8 -->




 <div class="large-4 medium-4 columns">
  <div class="hide-for-small">
    <div id="sidebar" class="sidebar">
          <div id="site-info" class="site-info">
            
                <h1>NeilBlog</h1>
                <div class="site-des"></div>
                <div class="social">











  <a target="_blank" class="rss" href="atom.xml" title="RSS">RSS</a>
                
              	 </div>
          	</div>

             

              <div id="site-categories" class="side-item ">
                <div class="side-header">
                  <h2>Categories</h2>
                </div>
                <div class="side-content">

      	<p class="cat-list">
        
            <a href="Python.html"><strong>Python</strong></a>
        
            <a href="opentstack-neutron.html"><strong>opentstack-neutron</strong></a>
        
            <a href="%E6%8A%80%E6%9C%AF%E5%91%A8%E8%BE%B9.html"><strong>技术周边</strong></a>
        
            <a href="%E9%A1%B9%E7%9B%AE%E7%AC%94%E8%AE%B0.html"><strong>项目笔记</strong></a>
         
        </p>


                </div>
              </div>

              <div id="site-categories" class="side-item">
                <div class="side-header">
                  <h2>Recent Posts</h2>
                </div>
                <div class="side-content">
                <ul class="posts-list">
	      
		      
			      <li class="post">
			        <a href="15623333744762.html">bytes/string转换</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15622929808447.html">netconf client通信框架</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15621228986145.html">devstack 安装openstack</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15620552731750.html">neutron agent 使用netconf向设备下发配置</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15620392963346.html">loggging模块</a>
			      </li>
		     
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		   
		  		</ul>
                </div>
              </div>
        </div><!-- sidebar -->
      </div><!-- hide for small -->
</div><!-- large 4 -->

</div><!-- row -->

 <div class="page-bottom clearfix">
  <div class="row">
   <p class="copyright">Copyright &copy; 2015
Powered by <a target="_blank" href="http://www.mweb.im">MWeb</a>,&nbsp; 
Theme used <a target="_blank" href="http://github.com">GitHub CSS</a>.</p>
  </div>
</div>

        </section>
      </div>
    </div>

  
    

    <script src="asset/js/foundation.min.js"></script>
    <script>
      $(document).foundation();
      function fixSidebarHeight(){
        var w1 = $('.markdown-body').height();
          var w2 = $('#sidebar').height();
          if (w1 > w2) { $('#sidebar').height(w1); };
      }
      $(function(){
        fixSidebarHeight();
      })
      $(window).load(function(){
          fixSidebarHeight();
      });
     
    </script>

    
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({TeX: { equationNumbers: { autoNumber: "AMS" } }});</script>


  </body>
</html>
